unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    function GetVarType(AValue:Variant):string; 
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TForm1 }

function TForm1.GetVarType(AValue: Variant): string;
begin
  case varType(AValue) of
    varEmpty     : Result :='Unassigned';
    varNull      : Result := 'Null';
    varSmallint  : Result := 'Smallint';
    varInteger   : Result := 'integer';
    varSingle    : Result := 'Single';
    varDouble    : Result := 'double';
    varCurrency  : Result := 'Currency';
    varDate      : Result := 'TDateTime';
    varOleStr    : Result := 'OleStr';
    varDispatch  : Result := 'Dispatch';
    varError     : Result := 'error';
    varBoolean   : Result := 'boolean';
    varVariant   : Result := 'variant';
    varUnknown   : Result := 'unknown';
    varShortInt  : Result := 'ShortInt';
    varByte      : Result := 'Byte';
    varWord      : Result := 'Word';
    varLongWord  : Result := 'LongWord';
    varInt64     : Result := 'integer';
    varStrArg    : Result := 'strArg';
    varString    : Result := 'string';
    varAny       : Result := 'Any';
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
  w: word;
  b: Boolean;
  E: Tdatetime;
begin
  showmessage(getVarType(i));  {Integer}
  showmessage(getVarType(w));  {word}
  showmessage(getVarType(b));  {Boolean}
  showmessage(getVarType(E));  {Tdatetime}
end;


end.
